<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>具名插槽的使用</title>
  </head>
  <body>
    <div id="app">
      <cpn><span>文字</span></cpn>
      <br />
      <cpn><span slot="middle">title</span></cpn>
    </div>
    <script src="../vue.js"></script>
    <template id="cpn">
      <div>
        <slot name="left"><span>左边</span></slot>
        <slot name="middle"><span>中间</span></slot>
        <slot name="right"><span>右边</span></slot>
        <slot><span>haha</span></slot>
      </div>
    </template>
    <script>
      const app = new Vue({
        el: "#app",
        data: {
          message: "hello",
        },
        components: {
          cpn: {
            template: "#cpn",
          },
        },
      });
    </script>
  </body>
</html>
